package com.yyp.action;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;
import com.yyp.dao.ManagerInfoDao;

@Controller
public class SkipAction {
	private static String imName = null;
	private String imPassword;

	public String getImName() {
		return imName;
	}

	public void setImName(String imName) {
		this.imName = imName;
	}

	public String getImPassword() {
		return imPassword;
	}

	public void setImPassword(String imPassword) {
		this.imPassword = imPassword;
	}

	static String date;
	static String time;

	static {
		date = new SimpleDateFormat("yyyy年MM月dd日").format(new Date());
		time = new SimpleDateFormat("hh:mm:ss").format(new Date());

	}

	public void init() {
		ActionContext.getContext().put("cName", "Ican公司");
		ActionContext.getContext().put("cInterne", "公司网站");
		ActionContext.getContext().put("name", imName);
		ActionContext.getContext().put("date", date);
		ActionContext.getContext().put("time", time);
	}

	@Resource
	ManagerInfoDao managerInfoDao;

	public String login() {

		if (!(managerInfoDao.find(imName) == null)) {
			if (managerInfoDao.find(imName).getImPassword().equals(imPassword)) {
				imName = managerInfoDao.find(imName).getImName();
				init();
				return "login";
			} else {
				return "input";
			}
		} else {
			return "input";
		}
	}

	public String index() {
		init();
		return "success";
	}

	public String baobiao() {
		init();
		return "success";
	}

	public String chakanriji() {
		init();
		return "success";
	}

	public String chaxun01() {
		init();
		return "success";
	}

	public String chaxun02() {
		init();
		return "success";
	}

	public String cheliang01() {
		init();
		return "success";
	}

	public String sheji01() {
		init();
		return "success";
	}

	public String sheji02() {
		init();
		return "success";
	}

	public String sheji03() {
		init();
		return "success";
	}

	public String sheji04() {
		init();
		return "success";
	}

	public String tuoyun01() {
		init();
		return "success";
	}

	public String yanshou01() {
		init();
		return "success";
	}

	public String tuoyunguanli01() {
		init();
		return "success";
	}

	public String yonghuguanli() {
		init();
		return "success";
	}

	public String zaitugenzhong01() {
		init();
		return "success";
	}

}
